package org.example.message.service;

import org.example.message.mapper.MessageMapper;
import org.example.message.model.MessageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 22652
 * Date: 2024-07-13
 * Time: 9:48
 */
@Service
public class MessageService {
    @Autowired
    private MessageMapper messageMapper;

    public void addMessage(MessageInfo messageInfo){
        messageMapper.insertMessage(messageInfo);
    }

    public List<MessageInfo> getMessage(){
        return messageMapper.selectAllMessage();
    }
}
